import request from '@/utils/request'

export function sysAreaTree() {
  return request({
    url: '/system/sysAreaTree',
    method: 'get'
  })
}

//通用上传文件
export function uploadFile(data) {
  return request({
    url: '/common/file/upload',
    method: 'post',
    data,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  })
}

//通用删除文件
export function deleteFile(id) {
  return request({
    url: `/common/file/delete/${id}`,
    method: 'get'
  })
}


//通用查看文件
export function previewFile(id) {
  return request({
    url: `/common/file/preview/${id}`,
    method: 'get',
    responseType: 'blob'
  })
}

//枚举列表
export function getCommonEnums() {
  return request({
    url: `/common/enums`,
    method: 'get',
  })
}


//获取登录日志
export function getLoginLog(data) {
  return request({
    url: '/member/login/log/page/list',
    method: 'post',
    data
  })
}